π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal vulnerability#24
π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal vulnerability#24bitcoiner-dev wants to merge 1 commit intomasterfrom
Conversation
β¦mmands Adds a strict `validate_file_name` function to sanitize user input (profile and snapshot names) before constructing file paths, preventing arbitrary directory access. Co-authored-by: bitcoiner-dev <75873427+bitcoiner-dev@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: CRITICAL
π‘ Vulnerability: A path traversal vulnerability existed where unvalidated user input (
config.profileandnamein snapshot commands) was directly concatenated into file paths (e.g.,snapshots/{name}.json), allowing the use of relative path components like../to access or overwrite arbitrary files outside the intended directories.π― Impact: An attacker or malicious input could bypass directory sandbox restrictions, leading to critical wallet data exposure, state corruption, or arbitrary file overwrites.
π§ Fix: Implemented
crate::utils::validate_file_namewhich enforces strict input validation, exclusively allowing ASCII alphanumeric characters, underscores, and dashes. Integrated this check intoprofile_path,snapshot_dirinsrc/paths.rs, and theSaveandRestoresnapshot actions insrc/commands/snapshot.rs.β Verification:
cargo testconfirms the changes don't break existing functionality, and manual code review ensures no path-related logic operates on invalid user data.PR created automatically by Jules for task 7150576098070390315 started by @bitcoiner-dev